package com.jemmyee.pizza.service;

import java.io.Serializable;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.criterion.DetachedCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.jemmyee.core.dao.Page;
import com.jemmyee.pizza.dao.ICostUnlockDao;
import com.jemmyee.pizza.entity.CostUnlock;

@Repository("costUnlockService")
public class CostUnlockServiceImpl implements ICostUnlockService<CostUnlock>{

	private static final Log log = LogFactory.getLog(CostUnlockServiceImpl.class) ;
	@Autowired
	private ICostUnlockDao costUnlockDao ;
	
	public void delete(CostUnlock entity) {
		costUnlockDao.delete(entity) ;
	}

	public void deleteAll(List<CostUnlock> list) {
		costUnlockDao.deleteAll(list) ;
	}

	public void deleteById(Serializable id) {
		costUnlockDao.deleteById(id) ;
	}

	public List<CostUnlock> findAll() {
		return costUnlockDao.findAll(new CostUnlock());
	}

	public List<CostUnlock> findByCriteria(DetachedCriteria criteria) {
		return costUnlockDao.findByCriteria(criteria);
	}

	public CostUnlock findById(Serializable id) {
		return costUnlockDao.findById(id);
	}

	public List<CostUnlock> findByProperty(String propertyName, Object value) {
		return costUnlockDao.findByProperty(new CostUnlock(), propertyName, value);
	}

	public Page findPageByCriteria(DetachedCriteria detachedCriteria,
			int pageSize, int startIndex,String order) {
		return costUnlockDao.findPageByCriteria(detachedCriteria, pageSize, startIndex, order);
	}

	public void save(CostUnlock entity) {
		costUnlockDao.save(entity) ;
	}

	public void update(CostUnlock entity) {
		costUnlockDao.update(entity) ;
	}

}
